﻿using System.Collections.Generic;

namespace Bilibili.Model.Bangumi
{
    public sealed class MyBangumi
    {
        public int Code { get; set; }
        public string Message { get; set; }
        public string Count { get; set; }
        public List<MyBangumi> Result { get; set; }
        public string Badge { get; set; }
        public string Brief { get; set; }
        private string _cover;
        public string Cover
        {
            get { return _cover + "@300w.jpg"; }
            set { _cover = value; }
        }
        public string Is_Finish { get; set; }
        public int Is_Started { get; set; }
        public string Title { get; set; }
        public int Season_Id { get; set; }
        public string Newest_Ep_Index { get; set; }
        public string Total_Count { get; set; }
        public MyBangumi User_Season { get; set; }
        public string Last_Ep_Index { get; set; }
        public string Weekday { get; set; }
        public bool Vis
        {
            get
            {
                return (Badge != null && Badge.Length != 0);
            }
        }
        public string ViewAt
        {
            get
            {
                if (User_Season.Last_Ep_Index.Length != 0)
                    return "看到第" + User_Season.Last_Ep_Index + "话";
                else
                    return "尚未观看";
            }
        }
        public string New
        {
            get
            {
                if (Is_Finish == "0")
                    return Newest_Ep_Index == "-1" ? "尚未开播" : "更新至第" + Newest_Ep_Index + "话";
                else
                    return Total_Count + "话全";
            }
        }
        public string Favorites { get; set; }
        public string FavouritesCount
        {
            get
            {
                double d = double.Parse(Favorites) / 10000;
                return d >= 1 ? d.ToString("0.0") + "万" : Favorites;
            }
        }
    }
}